{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "f = open('log.txt', 'w')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "20190726_09:03:10 -  0\n",
      "20190726_09:03:11 -  1\n",
      "20190726_09:03:12 -  2\n",
      "20190726_09:03:13 -  3\n",
      "20190726_09:03:14 -  4\n",
      "20190726_09:03:15 -  5\n",
      "20190726_09:03:16 -  6\n",
      "20190726_09:03:17 -  7\n",
      "20190726_09:03:18 -  8\n",
      "20190726_09:03:19 -  9\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "import time\n",
    "\n",
    "for i in range(0,10):\n",
    "    print(datetime.now().strftime('%Y%m%d_%H:%M:%S - '),i)\n",
    "    f.write(datetime.now().strftime('%Y%m%d_%H:%M:%S - '));\n",
    "    time.sleep(1)\n",
    "    f.write(str(i));\n",
    "    f.write(\"\\n\")\n",
    "f.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
